package com.kedsoft.docms.service.impl;

import com.kedsoft.docms.entity.Rule;
import com.kedsoft.docms.mapper.RuleMapper;
import com.kedsoft.docms.service.RuleService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.kedsoft.docms.vo.Pagination;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author LGP
 * @since 2018-11-13
 */
@Service
public class RuleServiceImpl extends ServiceImpl<RuleMapper, Rule> implements RuleService {
    @Override
    public Pagination<Rule> pageList(Pagination<Rule> pagination, Map<String, Object> param) {
        param.put("offset", pagination.offset());
        param.put("limit", pagination.limit());
        param.put("sort", pagination.getSort());
        param.put("order", pagination.getOrder());
        pagination.setItems(baseMapper.list(param));
        pagination.setTotal(baseMapper.count(param));
        return pagination;
    }
}
